home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
User's Choice Windows CD
/
User's Choice Windows CD (CMS Software)(1993).iso
/
win_m_p
/
pwez51.zip
/
TIPS.DOC
< prev
next >
Wrap
Text File
|
1992-04-01
|
6KB
|
146 lines
TIPS AND SUGGESTIONS
NOTE: Argument designations are those used in the
documentation - WIND_REZ.DOC.
1. Pulldown and scroll windows require a dummy array to hold
the info-line data when the info-line is not used. All
modules and calls to SCRLWIND and PULLDOWN may use the
same dummy array.
Place this in the main module:
COMMON SHARED /DUMMYDATA/ DUMMY$()
DIM DUMMY$(0)
Place this in any other module using routines PULLDOWN or
SCRLWIND not using the info-line.
COMMON SHARED /DUMMYDATA/ DUMMY$()
Use DUMMY$() to represent the info-line ( when it is not
used ) in calls to SCRLWIND and PULLDOWN.
2. QuickBASIC 4+ can be very unpredictable when using ON
ERROR GO TO .. in a sub program or function unless the
sub program or routine is STATIC.
The following is OK.
SUB TEST ( A%, B% ) STATIC
ON ERROR GOTO LABEL ' LABEL MUST BE AT MODULE LEVEL
END SUB
The following can cause a STRING SPACE CORRUPT error, a
crash, or the program may bind. It may work fine in the
QB environment, but may cause problems in the executable
program.
SUB TEST ( A%, B% ) ' No STATIC
ON ERROR GOTO LABEL ' LABEL MUST BE AT MODULE LEVEL
END SUB
If the ON ERROR and LABEL are both in the main module the
problem does not occur.
3. It is important to know if an active PULLDOWN or INPUT
window exits. If either unknowingly exists the following
will occur on entry to the routines.
- Routine INPTWIND will place a field without a window in
the location it would occupy based on the coordinates of
the active input window. The coordinates in the call to
INPTWIND are ignored.
- Routine PULLDOWN is re-entered in the active pulldown
window at same location it was at when it was exited. If
the active input window is not intact it is not re-
displayed. The entries in the active pulldown window
are re-printed without the window.
4. Routine MULTINPT is ALWAYS exited when the cursor leaves a
"FIXED CHOICE" field. Use argument RKEY% to determine if
the SPACE BAR exited MULTINPT. Remember, even if the
SPACE BAR is not pressed a FIXED CHOICE field will be
exited any time the cursor leaves it, or an exit key is
pressed.
If field 5 ( AUTOEXIT% = 5 on exit ) is a FIXED CHOICE
field, on exit from routine MULTINPT the following will
determine why field 5 caused the exit.
'RKEY% represents the exit key.
IF AUTOEXIT% = 5 THEN ' Exit was on field 5.
IF RKEY% = 32 THEN ...
' SPACE BAR caused the exit
ELSE
' Cursor leaving field 5 or an exit key ( F1, F2,
' etc. ) caused the exit. If exit was not by the
' SPACE BAR the program will ALWAYS proceed here
' as a FIXED CHOICE field is ALWAYS an auto-exit
' field and MULTINPT is ALWAYS exited. It may be
' appropriate to do nothing and simply re-enter
' MULTINPT in this case.
END IF
END IF
5. If several small windows are placed entirely within a
larger window it may not be necessary to restore the
display area under each window. If the display area under
the larger window is to be restored it may only be
necessary to delete the smaller windows via routine
DELWIND and restore the display area under the larger
window with routine RSTRWIND. This is faster and more
memory efficient than restoring all of the windows.
6. If partial windows remain on the screen the most likely
cause is windows were restored out of order. The top
window must be restored first if it is not entirely
inside the bottom window.
7. If a title for a virtual scroll window is defined in the
call to MAKEWIND for the scroll window, the title will
not scroll left and right. The title for virtual scroll
windows must be set by the argument for the top line in
routine SCRLWIND. ( TL$ )
8. The argument for the key character color in virtual
scroll windows must equal zero or an error 24 will be
reported. ( STRING WON'T FIT )
9. If all fields in a call to MULTINPT are not updated on
entry the cause is argument AUTOEXIT% does not equal
zero. AUTOEXIT% sets single field update if not zero.
10. It may appear the input routines are not working if the
text is the same color as the fields.
11. Functions MUST be declared in all modules using them.
12. If routine B4SCRL is used to set up a call to SCRLWIND
use it immediately before the call to SCRLWIND. Do not
allow anything to change the program flow between the
calls to B4SCRL and SCRLWIND. Doing so may result in a
different scroll window assuming the options specified by
the call to B4SCRL.